<?php


namespace App\Transformers;


use League\Fractal\TransformerAbstract;

class QrcodeTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
    return [
         'id'=>$data->id ,
         'user_id' =>$data->user_id ?? '',
         'third_type' =>$data->third_type ?? '',
         'ticket' =>$data->ticket ?? '',
         'expire_time' =>$data->expire_time ?? '',
         'qrcode_url' =>$data->qrcode_url ?? '',
         'type' =>$data->type ?? '',
         'status' =>$data->status ?? '',
         'url' =>$data->url ?? '',
         'scan' =>$data->scan ?? '',
        'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
        'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
    ];

    }


}
